04. Installing Python (Mac)
Using Python on Mac
These are the instructions for downloading and installing Python on a Mac (OS X). If you have a PC (Windows machine), skip this page, and follow the instructions for Windows computers.
Mac OS X comes with Python 2 already installed, so the following instructions are optional and are intended to give you the most up-to-date version of Python 2.
PLEASE NOTE: We are NOT using Python 3 in this Nanodegree program. There are significant differences between Python 2 and 3, and we will be using Python 2.
Go through the steps below to verify that you have an appropriate version of Python 2 installed on your Mac. We recommend that you have Python 2.7.9 or later. If you find that you do not have Python 2.7.9 or later, then we'll direct you to continue going through the instructions on this page to download and install the latest version of Python 2 (version 2.7.13) on your computer.
In case you're curious, the reason we recommend a Python 2 version of at least 2.7.9 is that this version comes with something called pip installed. Having pip already installed is convenient and can be beneficial later on in this program.
Checking Your Python Version
The instructions here will allow you to verify the version of Python installed on your computer.
Step #1:
Open the Spotlight application on your Mac. You can do so by using a keyboard shortcut: Command + spacebar.
Step #2:
With Spotlight open, type the word "Terminal" into the search area to search your Mac for the Terminal application. Double-click on the Terminal icon when it appears, or simply hit RETURN when the application is highlighted.
Step #3:
Once you're in the Terminal application, type the word python (uncapitalized), and hit RETURN on your keyboard. You should see a response from the computer that lists the version of Python that is installed on your Mac.
Step #4:
Verify that your installed version of Python 2 is at least 2.7.9 (or later). If this is the case, you're done with the instructions on this page. You can close the Terminal application and move on to the next node that shows you how to set up your workspace (on Mac).
If, for some reason, you see a version of Python 2 that precedes version 2.7.9, we recommend that you continue with the instructions on this page to download and install the latest version of Python 2 (version 2.7.13). Then, you should repeat the instructions in this section to verify the proper version has been installed. If you’re still seeing an older version of Python 2 at that point, then you may need to update something called your system’s PATH environment variable. Head to the Udacity Discussion Forums for guidance on doing so.
Downloading and Installing Python 2
Follow the instructions in this section only if your computer has a version of Python that precedes 2.7.9.
Downloading Python 2
Navigate to the Python website’s downloads section. You should see two options — Python 3.6.0 and Python 2.7.13. It’s essential that you choose Python 2.7.13 (instead of some version of Python 3) because we’re using Python 2 in this program.
Select Python 2.7.13 for download.
Installing Python 2
Once the download is complete, locate the installation file on your computer. It will probably be in your Downloads folder with the name python-2.7.13-macosx10.6.pkg. Run it by double-clicking on it. Go through the steps of the installation wizard, and follow the prompts as shown below.
Step #1: Introduction
Click Continue when you open the installation wizard.
Introduction section.
Step #2: Read Me
Click Continue again to go through the Read Me section.
Read Me section.
Step #3: License
Click Continue in the License section. You'll see a pop-up that asks you to agree to the terms of the software license agreement. Click Agree.
License section.
License terms agreement pop-up.
Step #4: Destination Select
Click Continue to select your Macintosh HD as an installation destination.
Destination selection.
Step #5: Installation Type
You should install in the default location by simply clicking Install.
Installation section.
Step #6: (Installation Process)
Proceed through the installation process. You may need to enter your username and password.
Installation may require that you enter your username and password.
Step #7: Summary
Click Finish to complete the installation process. You're done! You can now close the installation window.